import request from "../../utils/request"
import {
  HttpMethod
} from "../../utils/request"
import {
  parseStrEmpty
} from "../../utils/common"

// 请求菜品列表
export function listFood(query) {
  return request({
    url: "/canteen/food/list",
    method: HttpMethod.GET,
    data: query
  })
}

// 请求菜品详情
export function getFood(foodId) {
  return request({
    url: '/canteen/food/' + parseStrEmpty(foodId),
    method: HttpMethod.GET
  })
}

// 根据分类查询菜品
export function getFoodByKind(kindId) {
  return request({
    url: '/canteen/food/list',
    method: HttpMethod.GET,
    data: {
      kindId: kindId
    }
  })
}